{
{% if docker_insecure_registries is defined %}
  "insecure-registries": ["{{ docker_insecure_registries | join('", "') }}"],
{% endif %}
  "bip": "{{ docker_bip | default('172.17.0.1/16') }}",
  "exec-opts": ["native.cgroupdriver={{ docker_native_cgroupdriver }}"],
  "data-root": "{{ docker_path }}/docker",
  "max-concurrent-downloads": {{ docker_arg.max_concurrent_downloads | default('3') }},
  "max-concurrent-uploads": {{ docker_arg.max_concurrent_uploads | default('5') }},
  "icc": {{ docker_arg.icc | bool | to_json }},
  "ipv6": {% if ansible_default_ipv6 | length > 0 %}true{% else %}false{% endif %},
  "live-restore": {{ docker_arg.live_restore | bool | to_json }},
  "oom-score-adjust": -1000,
  "log-level": "{{ docker_arg.log_level }}",
  "selinux-enabled": {{ docker_selinux | bool | to_json }},
{% if syslog | bool %}
  "log-driver": "gelf",
  "log-opts": { 
    "gelf-address": "{{ syslog_protocol | lower }}://{{ syslog_server | list | random(seed=inventory_hostname) }}:{{ syslog_port }}",
    "tag": "in_docker"
  },
{% else %}
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "50m",
    "max-file": "10"
  },
{% endif %}
{% if docker_registry_mirrors is defined %}
  "registry-mirrors": ["{{ docker_registry_mirrors | join('", "') }}"],
{% endif %}
  "metrics-addr": "{{ ansible_default_ipv4.address }}:{{ docker_port.metrics_port }}",
{% if docker_dns is defined %}
  "dns": ["{{ docker_dns | join('", "') }}"],
{% endif %}
  "storage-driver": "{{ docker_arg.storage_driver }}",
  "storage-opts": [
    "overlay2.override_kernel_check={{ docker_arg.storage_opts.overlay2_override_kernel_check | bool | to_json }}"
  ],
  "experimental": true,
  "userland-proxy": {{ docker_arg.userland_proxy | bool | to_json }}
}
